import request from '@/utiles/request.js'

// 获取全部帖子列表
export const getPostsService = async () => {
  return await request.get('/posts')
}

// 获取单个帖子详情
export const getPostDetailService = async (postId) => {
  return await request.get(`/post/get/${postId}`)
}

// 创建新帖子
export const createPostService = async (postData) => {
  return await request.post('/posts', postData)
}

export const getPostListService = async (pageNum,pageSize,userId) => {
  return await request.get('/post/get/list',{
    params:{pageNum,pageSize,userId}
  })
}

//返回我及我关注的用户的文章，按时间顺序排序
export const getFollowPostService = async (pageNum,pageSize) => {
  return await request.get('/post/getfollow',{
    params:{pageNum,pageSize}
  })
}
export const getOtherUserPost = async (id) => {
  return await request.get(`/post/getuser/${id}`)
}

//返回我创作的文章
export const getMyPostService = async () => {
  return await request.get('/post/getmy')
}



